package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 3:08:52 PM by Hibernate Tools 3.2.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbTabla generated by hbm2java
 */
@Entity
@Table(name = "TB_TABLA", schema = "CATALOGOS")
public class TbTabla implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String ctablaTb;
	private String cusuario;
	private String dtabla;
	private Date fhingreso;
	private String mtipoUsuario;
	private String sdataWindow;
	private Set<TbHistorico> tbHistoricos = new HashSet<TbHistorico>(0);
	private Set<TbUsuaTabla> tbUsuaTablas = new HashSet<TbUsuaTabla>(0);

	public TbTabla() {
	}

	public TbTabla(String ctablaTb, String cusuario, String dtabla,
			Date fhingreso, String sdataWindow) {
		this.ctablaTb = ctablaTb;
		this.cusuario = cusuario;
		this.dtabla = dtabla;
		this.fhingreso = fhingreso;
		this.sdataWindow = sdataWindow;
	}

	public TbTabla(String ctablaTb, String cusuario, String dtabla,
			Date fhingreso, String mtipoUsuario, String sdataWindow,
			Set<TbHistorico> tbHistoricos, Set<TbUsuaTabla> tbUsuaTablas) {
		this.ctablaTb = ctablaTb;
		this.cusuario = cusuario;
		this.dtabla = dtabla;
		this.fhingreso = fhingreso;
		this.mtipoUsuario = mtipoUsuario;
		this.sdataWindow = sdataWindow;
		this.tbHistoricos = tbHistoricos;
		this.tbUsuaTablas = tbUsuaTablas;
	}

	@Id
	@Column(name = "C_TABLA_TB", unique = true, nullable = false, length = 18)
	public String getCtablaTb() {
		return this.ctablaTb;
	}

	public void setCtablaTb(String ctablaTb) {
		this.ctablaTb = ctablaTb;
	}

	@Column(name = "C_USUARIO", nullable = false, length = 30)
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@Column(name = "D_TABLA", nullable = false, length = 40)
	public String getDtabla() {
		return this.dtabla;
	}

	public void setDtabla(String dtabla) {
		this.dtabla = dtabla;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_INGRESO", nullable = false, length = 7)
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	@Column(name = "M_TIPO_USUARIO", length = 1)
	public String getMtipoUsuario() {
		return this.mtipoUsuario;
	}

	public void setMtipoUsuario(String mtipoUsuario) {
		this.mtipoUsuario = mtipoUsuario;
	}

	@Column(name = "S_DATA_WINDOW", nullable = false, length = 30)
	public String getSdataWindow() {
		return this.sdataWindow;
	}

	public void setSdataWindow(String sdataWindow) {
		this.sdataWindow = sdataWindow;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbTabla")
	public Set<TbHistorico> getTbHistoricos() {
		return this.tbHistoricos;
	}

	public void setTbHistoricos(Set<TbHistorico> tbHistoricos) {
		this.tbHistoricos = tbHistoricos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbTabla")
	public Set<TbUsuaTabla> getTbUsuaTablas() {
		return this.tbUsuaTablas;
	}

	public void setTbUsuaTablas(Set<TbUsuaTabla> tbUsuaTablas) {
		this.tbUsuaTablas = tbUsuaTablas;
	}

}
